package com.show.business.integrate.controller;

import com.show.business.common.core.controller.BaseController;
import com.show.business.integrate.bean.SmsMessage;
import com.show.business.integrate.service.ISmsMessageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 短信发送记录 前端控制器
 * </p>
 *
 * @author dvlp
 * @since 2024-09-30
 */
@Api(value = "短信发送记录",description = "短信发送记录")
@RestController
@RequestMapping("/integrate/smsMessage")
public class SmsMessageController extends BaseController {
    @Resource
    private ISmsMessageService smsMessageService;
    /**
     * 获取短信发送记录列表
     */
    @ApiOperation("获取短信发送记录列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "Integer", dataTypeClass = Integer.class),
            @ApiImplicitParam(name = "pageSize", value = "每页大小", dataType = "Integer", dataTypeClass = Integer.class)
    })
    @GetMapping("/page")
    public Object getPage(SmsMessage smsMessage) {
        startPage();
        List<SmsMessage> list = smsMessageService.getList(smsMessage);
        return getDataTable(list);
    }
    /**
     * 短信发送记录详情
     */
    @ApiOperation("详情")
    @ApiImplicitParam(name = "id", value = "主键ID", required = true, dataType = "String", dataTypeClass = String.class)
    @GetMapping("/info")
    public Object getInfo(@RequestParam String id) {
        return smsMessageService.getInfo(id);
    }
}
